// 医疗库
import  request  from "@/utils/axios";
import appName from "../appName"
const timeout = 900000;

/* -----通用属性 start */
// 查询通用属性
export function getGeneralPropertiesApi(params) {
  return request({
    url: appName.AUSCONFING + '/aus/general/getGeneralProperties',
    method: 'post',
    data: params,
    timeout:timeout
  })
}

// 根据通用属性id通用属性查看详情
export function getCommonInfoApi(params) {
  return request({
    url: appName.AUSCONFING + '/aus/general/getCommonInfo?id=' + params.id,
    method: 'post',
    timeout:timeout
  })
}

// 根据通用属性id通用属性查看详情
export function getAttributeSortApi(params) {
  return request({
    url: appName.AUSCONFING + '/aus/general/getAttributeSort?id=' + params.id,
    method: 'post',
    timeout:timeout
  })
}

// 删除通用属性
export function delGeneralPropertiesApi(params) {
  return request({
    url: appName.AUSCONFING + '/aus/general/delGeneralProperties',
    method: 'post',
    data: params,
    timeout:timeout
  })
}

// 新增或修改通用属性
export function addOrUpdateGeneralPropertiesApi(params) {
  return request({
    url: appName.AUSCONFING + '/aus/general/addOrUpdateGeneralProperties',
    method: 'post',
    data: params,
    timeout:timeout
  })
}

/* end */

/* ------体检标准化 start */
// 查询通用属性
export function getPhysicalStandMenuApi(params) {
  return request({
    url: appName.AUSCONFING + '/aus/physicalStandardization/getPhysicalStandMenu',
    method: 'post',
    data: params,
    timeout:timeout
  })
}

// 查询标准化属性信息
export function getPhysicalStandAttributeInfoApi(params) {
  let url = '/aus/physicalStandardization/getPhysicalStandAttributeInfo'
  Object.keys(params).forEach((key,index) => {
    if(index == 0) url = `${url}?${key}=${params[key]}`
    else url = `${url}&${key}=${params[key]}`
  })
  return request({
    url: appName.AUSCONFING + url,
    method: 'post',
    timeout:timeout
  })
}

// 查询标准化属性值信息
export function getPhysicalCommonValueApi(params) {
  return request({
    url: appName.AUSCONFING + '/aus/physicalStandardization/getPhysicalCommonValue',
    method: 'post',
    data: params,
    timeout:timeout
  })
}

// 查询体检项标准化菜单项目
export function getPhysicalStandMenuListApi(params) {
  return request({
    url: appName.AUSCONFING + '/aus/physicalStandardization/getPhysicalStandMenuList',
    method: 'post',
    data: params,
    timeout:timeout
  })
}

// 删除删除标准化属性
export function delPhysicalStandAttributeInfoApi(params) {
  return request({
    url: appName.AUSCONFING + '/aus/physicalStandardization/delPhysicalStandAttributeInfo',
    method: 'post',
    data: params,
    timeout:timeout
  })
}

// 删除体检项标准化
export function delPhysicalStandMenuApi(params) {
  return request({
    url: appName.AUSCONFING + '/aus/physicalStandardization/delPhysicalStandMenu?id=' + params,
    method: 'post',
    timeout:timeout
  })
}

// 删除标准化属性值信息
export function delPhysicalCommonValueApi(params) {
  return request({
    url: appName.AUSCONFING + '/aus/physicalStandardization/delPhysicalCommonValue',
    method: 'post',
    data: params,
    timeout:timeout
  })
}

// 删除同义词信息
export function delSynonymInfoApi(params) {
  return request({
    url: appName.AUSCONFING + '/aus/physicalStandardization/delSynonymInfo?id=' + params,
    method: 'post',
    timeout:timeout
  })
}

// 新增标准化属性
export function addPhysicalStandAttributeInfoApi(params) {
  return request({
    url: appName.AUSCONFING + '/aus/physicalStandardization/addPhysicalStandAttributeInfo',
    method: 'post',
    data: params,
    timeout:timeout
  })
}

// 新增体检项标准化
export function addPhysicalStandMenuApi(params) {
  return request({
    url: appName.AUSCONFING + '/aus/physicalStandardization/addPhysicalStandMenu',
    method: 'post',
    data: params,
    timeout:timeout
  })
}

// 保存标准化属性值信息
export function savePhysicalCommonValueApi(params) {
  return request({
    url: appName.AUSCONFING + '/aus/physicalStandardization/savePhysicalCommonValue',
    method: 'post',
    data: params,
    timeout:timeout
  })
}

// 查询标准化属性值同义词信息
export function selectPropertySynonymyListApi(params) {
  return request({
    url: appName.AUSCONFING + '/aus/physicalStandardization/selectPropertySynonymyList',
    method: 'post',
    data: params,
    timeout:timeout
  })
}

// 添加标准化属性值同义词信息
export function addPropertySynonymyListApi(params) {
  return request({
    url: appName.AUSCONFING + '/aus/physicalStandardization/addPropertySynonymyList',
    method: 'post',
    data: params,
    timeout:timeout
  })
}

// 删除标准化属性值同义词信息
export function delectPropertySynonymyListApi(params) {
  return request({
    url: appName.AUSCONFING + '/aus/physicalStandardization/delectPropertySynonymyList',
    method: 'post',
    data: params,
    timeout:timeout
  })
}
/* end */

/* ----------体检项目库 start */
// 查询项目体检库疾病基本信息
export function getExamProjectInfoApi(params) {
  return request({
    url: appName.AUSCONFING + `/aus/medicalLibrary/getExamProjectInfo?id=${params.id}`,
    method: 'post',
    timeout:timeout
  })
}

// 添加项目
export function insExamProjectLibraryApi(params) {
  return request({
    url: appName.AUSCONFING + '/aus/medicalLibrary/insExamProjectLibrary',
    method: 'post',
    data: params,
    timeout:timeout
  })
}

// 保存项目体检库
export function saveSonProjectInfoApi(params) {
  return request({
    url: appName.AUSCONFING + '/aus/medicalLibrary/saveSonProjectInfo',
    method: 'post',
    data: params,
    timeout:timeout
  })
}

// 删除项目体检库子项目
export function delSonProjectInfoApi(params) {
  return request({
    url: appName.AUSCONFING + `/aus/medicalLibrary/delSonProjectInfo?id=${params.id}`,
    method: 'get',
    timeout:timeout
  })
}
/* end */